<? //PRODUCT_add.php;
$msg="";
include("PRODUCT_session.php");
if(isset($_POST["submit"]))
{
	$data_class = new PRODUCT();$data_class->setProductID($_POST["ProductID"]);
	$data_class->setSKU($_POST["SKU"]);
	$data_class->setSupplierProductID($_POST["SupplierProductID"]);
	$data_class->setProductName($_POST["ProductName"]);
	$data_class->setProductDescription($_POST["ProductDescription"]);
	$data_class->setSupplierID($_POST["SupplierID"]);
	$data_class->setCategoryID($_POST["CategoryID"]);
	$data_class->setQuantityPerUnit($_POST["QuantityPerUnit"]);
	$data_class->setUnitSize($_POST["UnitSize"]);
	$data_class->setUnitPrice($_POST["UnitPrice"]);
	$data_class->setMSRP($_POST["MSRP"]);
	$data_class->setAvailableSIze($_POST["AvailableSIze"]);
	$data_class->setAvailableColors($_POST["AvailableColors"]);
	$data_class->setSizeID($_POST["SizeID"]);
	$data_class->setColorID($_POST["ColorID"]);
	$data_class->setDiscount($_POST["Discount"]);
	$data_class->setUnitWeight($_POST["UnitWeight"]);
	$data_class->setUnitInStock($_POST["UnitInStock"]);
	$data_class->setUnitsOnOrder($_POST["UnitsOnOrder"]);
	$data_class->setReorderLevel($_POST["ReorderLevel"]);
	$data_class->setProductAvailable($_POST["ProductAvailable"]);
	$data_class->setDiscountAvailable($_POST["DiscountAvailable"]);
	$data_class->setCurrentOrder($_POST["CurrentOrder"]);
	$data_class->setPicture($_POST["Picture"]);
	$data_class->setRanking($_POST["Ranking"]);
	$data_class->setNote($_POST["Note"]);
	$insert_class = new SessionPRODUCT();
	$insert_class->insert($data_class);
	$msg = "Success Insert Data";
}
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Insert Data To Table PRODUCT</title>
<script src="js/jquery.js"></script>
<script type="text/javascript" src="js/jquery_validate.js"></script>
  <script>
  $(document).ready(function(){
    $("#form").validate();
  });
  </script>
</head>

<body>
<h2><?=$msg;?></h2><form name="form1" id="form" method="post" action="<?=$_SERVER["PHP_SELF"];?>">
  <table width="657" border="1">
    <tr>
      <td colspan="3">INSERT DATA</td>
    </tr><tr>
      <td width="97">ProductID</td>
      <td width="3">:</td>
      <td width="535"><input type="text" name="ProductID" value="" class="required " minlength="0" maxlength="25" /></td>
    </tr><tr>
      <td width="97">SKU</td>
      <td width="3">:</td>
      <td width="535"><input type="text" name="SKU" value="" class="required " minlength="0" maxlength="25" /></td>
    </tr><tr>
      <td width="97">SupplierProductID</td>
      <td width="3">:</td>
      <td width="535"><input type="text" name="SupplierProductID" value="" class="required " minlength="0" maxlength="25" /></td>
    </tr><tr>
      <td width="97">ProductName</td>
      <td width="3">:</td>
      <td width="535"><input type="text" name="ProductName" value="" class="required " minlength="0" maxlength="25" /></td>
    </tr><tr>
      <td width="97">ProductDescription</td>
      <td width="3">:</td>
      <td width="535"><input type="text" name="ProductDescription" value="" class="required " minlength="0" maxlength="25" /></td>
    </tr><tr>
      <td width="97">SupplierID</td>
      <td width="3">:</td>
      <td width="535"><input type="text" name="SupplierID" value="" class="required " minlength="0" maxlength="25" /></td>
    </tr><tr>
      <td width="97">CategoryID</td>
      <td width="3">:</td>
      <td width="535"><input type="text" name="CategoryID" value="" class="required " minlength="0" maxlength="25" /></td>
    </tr><tr>
      <td width="97">QuantityPerUnit</td>
      <td width="3">:</td>
      <td width="535"><input type="text" name="QuantityPerUnit" value="" class="required " minlength="0" maxlength="25" /></td>
    </tr><tr>
      <td width="97">UnitSize</td>
      <td width="3">:</td>
      <td width="535"><input type="text" name="UnitSize" value="" class="required " minlength="0" maxlength="25" /></td>
    </tr><tr>
      <td width="97">UnitPrice</td>
      <td width="3">:</td>
      <td width="535"><input type="text" name="UnitPrice" value="" class="required " minlength="0" maxlength="25" /></td>
    </tr><tr>
      <td width="97">MSRP</td>
      <td width="3">:</td>
      <td width="535"><input type="text" name="MSRP" value="" class="required " minlength="0" maxlength="25" /></td>
    </tr><tr>
      <td width="97">AvailableSIze</td>
      <td width="3">:</td>
      <td width="535"><input type="text" name="AvailableSIze" value="" class="required " minlength="0" maxlength="25" /></td>
    </tr><tr>
      <td width="97">AvailableColors</td>
      <td width="3">:</td>
      <td width="535"><input type="text" name="AvailableColors" value="" class="required " minlength="0" maxlength="25" /></td>
    </tr><tr>
      <td width="97">SizeID</td>
      <td width="3">:</td>
      <td width="535"><input type="text" name="SizeID" value="" class="required " minlength="0" maxlength="25" /></td>
    </tr><tr>
      <td width="97">ColorID</td>
      <td width="3">:</td>
      <td width="535"><input type="text" name="ColorID" value="" class="required " minlength="0" maxlength="25" /></td>
    </tr><tr>
      <td width="97">Discount</td>
      <td width="3">:</td>
      <td width="535"><input type="text" name="Discount" value="" class="required " minlength="0" maxlength="25" /></td>
    </tr><tr>
      <td width="97">UnitWeight</td>
      <td width="3">:</td>
      <td width="535"><input type="text" name="UnitWeight" value="" class="required " minlength="0" maxlength="25" /></td>
    </tr><tr>
      <td width="97">UnitInStock</td>
      <td width="3">:</td>
      <td width="535"><input type="text" name="UnitInStock" value="" class="required " minlength="0" maxlength="25" /></td>
    </tr><tr>
      <td width="97">UnitsOnOrder</td>
      <td width="3">:</td>
      <td width="535"><input type="text" name="UnitsOnOrder" value="" class="required " minlength="0" maxlength="25" /></td>
    </tr><tr>
      <td width="97">ReorderLevel</td>
      <td width="3">:</td>
      <td width="535"><input type="text" name="ReorderLevel" value="" class="required " minlength="0" maxlength="25" /></td>
    </tr><tr>
      <td width="97">ProductAvailable</td>
      <td width="3">:</td>
      <td width="535"><input type="text" name="ProductAvailable" value="" class="required " minlength="0" maxlength="25" /></td>
    </tr><tr>
      <td width="97">DiscountAvailable</td>
      <td width="3">:</td>
      <td width="535"><input type="text" name="DiscountAvailable" value="" class="required " minlength="0" maxlength="25" /></td>
    </tr><tr>
      <td width="97">CurrentOrder</td>
      <td width="3">:</td>
      <td width="535"><input type="text" name="CurrentOrder" value="" class="required " minlength="0" maxlength="25" /></td>
    </tr><tr>
      <td width="97">Picture</td>
      <td width="3">:</td>
      <td width="535"><input type="text" name="Picture" value="" class="required " minlength="0" maxlength="25" /></td>
    </tr><tr>
      <td width="97">Ranking</td>
      <td width="3">:</td>
      <td width="535"><input type="text" name="Ranking" value="" class="required " minlength="0" maxlength="25" /></td>
    </tr><tr>
      <td width="97">Note</td>
      <td width="3">:</td>
      <td width="535"><input type="text" name="Note" value="" class="required " minlength="0" maxlength="25" /></td>
    </tr> <tr>
      <td></td>
      <td></td>
      <td><input type="submit" name="submit" value="Add" /></td>
    </tr>
   
  </table>
</form>
</body>
</html>